<template>
  <div class="header" :class="{noBanner: !isBanner}" :style="{height: !isBanner ? 'auto' : '418px'}">
    <div class="navbar overflow">
      <div class="logo fl">
        <img src="../../assets/images/logo.png">埔企通一站式企业服务平台
      </div>
      <div class="nav fl">
        <div
          v-for="(item, indx) in list"
          :key="indx"
          class="box pointer"
          :class="indx == tabIndex ? 'cur' : ''"
          @click="navClick(indx)"
        >
          {{ item }}<span v-if="indx == tabIndex" />
        </div>
      </div>

      <div class="user fr">
        <div class="box">凯通科技</div>
        <div class="bt">退出登录</div>
      </div>
    </div>
    <v-Banner v-if="isBanner" />
  </div>
</template>

<script>
import vBanner from './banner'
export default {
  components: {
    vBanner
  },
  data() {
    return {
      list: ['查企业', '企业邻居', '预警通'],
      tabIndex: 1
    }
  },
  computed: {
    isBanner() {
      return this.$route.meta.banner
    }
  },
  mounted() {

  },
  methods: {

  }
}
</script>

<style scoped lang="scss">
	.header {
    height: 418px;
    background: url(../../assets/images/busNeighbors/header.png) no-repeat left center;
    background-size: 100% 100%;

    .navbar {
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      height: 100px;
      padding: 0 30px;

      .logo {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100px;
        font-size: 26px;
        color: #fff;
        font-weight: bold;
        margin-right: 8%;

        img {
          margin-right: 11px;
        }
      }

      .nav {
        display: flex;
        height: 100px;
        justify-content: center;
        align-items: center;
        font-size: 20px;
        color: #fff;
        font-weight: bold;
        .box {
          position: relative;
          height: 100px;
          line-height: 100px;
          span {
            position: absolute;
            left: 0;
            bottom: 0;
            height: 5px;
            background: #fff;
            display: block;
            width: 60px;
          }
        }
        .box::after {
          content: "|";
          margin: 0 36px;
          color: rgba(255, 255, 255, 0.2);
          font-weight: initial;
          font-size: 18px;
        }

        .box:last-child::after {
          display: none;
        }
      }

      .user {
        display: flex;
        height: 95px;
        justify-content: center;
        align-items: center;

        .box {
          font-size: 16px;
          line-height: 28px;
          color: #ffffff;
          font-weight: 400;
          background: url(../../assets/images/usericon.png) no-repeat left
            center;
          padding-left: 22px;
        }

        .bt {
          width: 62px;
          height: 28px;
          line-height: 28px;
          text-align: center;
          background: #ffffff;
          border-radius: 5px 5px 5px 5px;
          font-size: 12px;
          color: #000000;
          font-weight: 400;
          margin-left: 10px;
          cursor: pointer;
        }
      }
    }
  }
  .noBanner{
    background: linear-gradient( 180deg, #3460D7 0%, #3D62CC 100%);
  }
</style>
